package com.javaweb.service.impl;

import com.javaweb.dao.CategoryDao;
import com.javaweb.model.Category;
import com.javaweb.service.CategoryService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class CategoryServiceImpl implements CategoryService {

    @Autowired
    private CategoryDao categoryDao;

    @Override
    public int add(Category category) {
        return categoryDao.insert(category);
    }

    @Override
    public int delete(Integer categoryId) {
        return categoryDao.delete(categoryId);
    }

    @Override
    public List<Category> list() {
        return categoryDao.list();
    }
}
